package com.sanyu.controller.admin;

import com.sanyu.pojo.dto.RepairRecordDTO;
import com.sanyu.pojo.dto.RepairRecordVerifyDTO;
import com.sanyu.pojo.dto.RepairRecordPageQueryDTO;
import com.sanyu.pojo.vo.RepairRecordVO;
import com.sanyu.pojo.vo.WorkRecordVO;
import com.sanyu.result.PageResult;
import com.sanyu.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/admin/repairRecord")
@Api("后台管理页面/报修记录(派单)管理相关接口")
public class RepairRecordController {

    @GetMapping("/{id}")
    @ApiOperation("根据派单ID获取所有从属工单ID")
    public Result<List<WorkRecordVO>> getWorkRecordsById(){
        List<WorkRecordVO> workRecordVOList = new ArrayList<>();
        return Result.success(workRecordVOList);
    }

    @PutMapping("/{id}")
    @ApiOperation("修改指定ID的报修记录")
    public Result update(@RequestBody RepairRecordDTO repairRecordDTO){
        return Result.success();
    }

    @GetMapping("/{id}")
    @ApiOperation("根据ID查询报修记录")
    public Result<RepairRecordVO> detail(@PathVariable Long id){
        RepairRecordVO repairRecordVO = new RepairRecordVO();
        return Result.success(repairRecordVO);
    }

    @GetMapping("/page")
    @ApiOperation("分页查询报修记录")
    public Result<PageResult> page(RepairRecordPageQueryDTO repairRecordPageQueryDTO){
        return Result.success(new PageResult());
    }

    @PostMapping("/verify")
    @ApiOperation("完成某一报修记录审核")
    public Result verify(@RequestBody RepairRecordVerifyDTO repairRecordVerifyDTO){
        return Result.success();
    }
}
